/*
 * @Descripttion: 
 * @version: 
 * @Author: wl
 * @Date: 2020-05-13 13:27:23
 * @LastEditors: wl
 * @LastEditTime: 2020-06-07 10:43:18
 */ 
import store from '@/store'
/**
 * 判断用户是否拥有操作权限
 * 根据传入的权限标识，查看是否存在用户权限标识集合
 * @param perms
 */
export function hasPermission (perms) {
    // let hasPermission = false
     let permissions = store.state.user.perms

    // console.log(permissions,"0000")
    
    // for(let i=0, len=permissions.length; i<len; i++) {
    //     if(permissions[i] === perms) {
    //         hasPermission = true;
    //         break
    //     }
    // }
    // return hasPermission
    return Array.isArray(permissions.data) && new Set(permissions.data).has(perms);
    
}
  
  